package cn.xmy.demo04.service;

import cn.xmy.demo04.mapper.HouseInfoMapper;
import cn.xmy.demo04.pojo.HouseInfo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;
@Service
public class HouseInfoServiceImpl implements HouseInfoService {
    @Autowired
    HouseInfoMapper houseInfoMapper;
    @Override
    public PageInfo<HouseInfo> selectPage(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<HouseInfo> houseInfoList=houseInfoMapper.selectAllHouseInfo();
        PageInfo<HouseInfo> pageInfo=new PageInfo<>(houseInfoList);
        return pageInfo;
    }
}
